'use strict';

const {Controller} = require('egg');
const ResponseUtil = require('../utils/ResponseUtil');

class ComplaintController extends Controller {


    async getComplaintList(){
        let query = this.ctx.query;
        query.delFlag = 0;
        const resp = await this.ctx.service.complaint.getComplaintList(query);
        return this.ctx.body = ResponseUtil.success(resp.list, resp.total);
    }


    async processComplaint(){
        let body = this.ctx.request.body;
        const resp = await this.ctx.service.complaint.processComplaint(body);
        return this.ctx.body = ResponseUtil.success(resp);
    }

}

module.exports = ComplaintController;
